package com.hoshiicloud.common.constant;



/**
 * 商品类型 :0-虚拟类商品,1-实物类商品
 *
 * @author: zhangshuhu
 * @descripton: 商品类型枚举
 * @date: 14:37 2019/5/27
 */
public enum GoodsTypeEnum {
    VIRTUAL_GOODS(0, "虚拟类商品"),
    FACTUAL_GOODS(1, "实物类商品");
    private int code;

    private String name;

    GoodsTypeEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public int getCode() {
        return this.code;
    }

    public String getName() {
        return this.name;
    }

    public static GoodsTypeEnum get(int code) {
        for (GoodsTypeEnum aparameterStatus : values()) {
            if (aparameterStatus.getCode() == code) {
                return aparameterStatus;
            }
        }
        return null;
    }

}
